<template>
	<view style="background-color: rgb(250, 250, 250);">
		<view class="header" :style="'padding-top: '+bartop+'px; padding-bottom:10rpx;background: rgba(0, 0, 0, 0);'">
			<view class="goodsmsgheader headertop" style="width: 100%;">
				<navigator open-type="navigateBack" style="padding:10rpx">
					<image src="/static/zfh.png" mode="aspectFit"></image>
				</navigator>
				
				<!-- <image src="/static/goodsmsghei.png" mode="aspectFit" bindtap="showmsg" wx:if="{{cartlen=='00'?false:true}}"><text>{{cartlen}}</text></image> -->
			</view>
		</view>
		<view>
			<swiper :indicator-dots="true" :autoplay="true" :interval="4000" :duration="1000" style="width: 100%;height:600rpx;">
				<swiper-item v-for="(item,index) in data.pics">
					<image mode="widthFix" style="width: 100%;" :src="item"></image>
				</swiper-item>
			</swiper>
		</view>
		<view class="" style="padding: 40rpx;">
			<view class="title">
				{{data.title}}{{hid>0?'-已报名':''}}
			</view>
			<view class="title1">
				<image src="/static/hdsj.png" mode=""></image>
				<view class="">{{data.stime}}</view>
			</view>
			<view class="title1">
				<image src="/static/hddw.png" mode=""></image>
				<view class="">{{data.address}}</view>
			</view>
			<view class="title2">
				{{data.desc}}
			</view>

			<view class="center">
				活动地点
			</view>

			<view class="dz">
				<map style="width: 100%;height: 400rpx;" :markers="markers" :longitude="data.address_et_lng" :latitude="data.address_et_lat"></map>
				<view class="dz1"></view>
				<view class="dz2">
					{{data.address}}
				</view>
			</view>
			<view class="center">
				活动详情
			</view>
			<view class="hdsj" v-html="data.content">
				
			</view>
			
			
		</view>
		<view class="bottom">
			<picker :range="share" mode="selector" range-key="name">
				<image  style="width: 118rpx; height: 118rpx;" src="../../../static/hdxqfx.png" mode=""></image>
			</picker>
			<view :class="'bottom'+data.baomingok" @click="gopay" v-if="hid==0">
				{{data.btntitle}}
			</view>
		</view>
	</view>
</template>

<script>
	//活动详情
	var that = this;
	export default {
		data() {
			return {
				bartop: 0,
				titles: 0,
				data:{},
				id:'',
				markers:[],
				share:[{name:'微信好友',value:'wexin'},{name:'朋友圈',value:'quan'}],
				hid:0
			}
		},
		onLoad(e) {
			that = this;
			this.bartop = this.$bartop;
			if(e.hid){
				that.id = e.hid;
				that.hid = e.hid;
			}else{
				that.id = e.id;
			}
			uni.setNavigationBarTitle({
				title:'活动报名'
			})
		},
		onShow() {
			that.getdata()
		},
		methods: {
			gopay(){
				if(!that.data.baomingok) return false;
				that.$gopage("/pages/center/huodong/pay?id="+that.id,1)
			},
			getdata(){
				uni.showLoading({
					title:'加载中...'
				})
				that.$post('api/gethuodong',{id:that.id}).then(res=>{
					uni.hideLoading()
					that.data = res.data;
					that.markers = [{latitude:res.data.address_et_lat,longitude:res.data.address_et_lng,width:20,height:30,title:res.data.address}]
				})
			}
		}
	}
</script>

<style lang="scss">
	.img {
		width: 100vw;
		height: 497rpx;
	}

	.title {
		margin: 40rpx 0;
		margin-top: 0rpx;
		font-size: 48rpx;
		font-family: Alibaba PuHuiTi;
		font-weight: 600;
		color: #333333;
	}

	.title1 {
		display: flex;
		align-items: center;
		margin-bottom: 20rpx;

		>view {
			margin-left: 10rpx;
			font-size: 24rpx;
			font-family: Alibaba PuHuiTi;
			font-weight: 400;
			color: #333333;
		}

		>image {
			width: 20rpx;
			height: 20rpx;
		}
	}

	.title2 {
		font-size: 24rpx;
		font-family: Alibaba PuHuiTi;
		font-weight: 400;
		color: #333333;
	}

	.center {
		margin-top: 60rpx;
		margin-bottom: 40rpx;
		font-size: 30rpx;
		font-family: Alibaba PuHuiTi;
		font-weight: 600;
		color: #333333;
	}

	.dz {
		background-color: white;
		border-radius: 5%;
		overflow: hidden;

		.dz1 {
			margin: 20rpx;
			font-size: 24rpx;
			font-family: Alibaba PuHuiTi;
			font-weight: 500;
			color: #333333;
		}

		.dz2 {
			margin-left: 20rpx;
			padding-bottom: 20rpx;
			font-size: 24rpx;
			font-family: Alibaba PuHuiTi;
			font-weight: 400;
			color: #333333;
		}
	}

	.hdsj {
		margin-bottom: 100rpx;
		display: flex;
		font-size: 24rpx;
		color: #333333;
		line-height: 48rpx;
	}

	.bottom {
		display: flex;
		align-items: center;
		justify-content: space-between;
		position: fixed;
		bottom:0px;
		width: 730rpx;
		padding: 20rpx;
		background-color: #FFFFFF;
		border-top: 1px #ecefef solid;

		>image {
			width: 118rpx;
			height: 118rpx;
		}

		.bottom1 {
			background-color: rgb(255, 174, 69);
			width: 509rpx;
			height: 116rpx;
			font-size: 36rpx;
			color: #FFFFFF;
			line-height: 116rpx;
			text-align: center;
			border-radius: 60rpx;
		}
		.bottom0 {
			background-color: rgb(148, 156, 156);
			width: 509rpx;
			height: 116rpx;
			font-size: 36rpx;
			color: #FFFFFF;
			line-height: 116rpx;
			text-align: center;
			border-radius: 60rpx;
		}

	}
</style>
